#!/bin/bash

# 导入主脚本中的IO监控函数
source /home/fslong/Documents/01-Projects/06-better_linux/cpu-scheduler/cpu_scheduler.sh

# 重写日志函数以避免干扰测试
log_message() {
    echo "[$(date '+%Y-%m-%d %H:%M:%S')] [$1] $2"
}

# 测试IO监控功能
echo "第一次调用IO监控:"
io_data1=$(get_io_load)
echo "结果: $io_data1"

echo "等待2秒..."
sleep 2

echo "第二次调用IO监控:"
io_data2=$(get_io_load)
echo "结果: $io_data2"

echo "等待2秒..."
sleep 2

echo "第三次调用IO监控:"
io_data3=$(get_io_load)
echo "结果: $io_data3"